﻿<phone:PhoneApplicationPage 
    x:Class="SST.Phone.View.SettingPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneSubtleBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="696" d:DesignWidth="480"
    d:DataContext="{d:DesignData ../SampleData/SettingViewModelSampleData.xaml}"
    shell:SystemTray.IsVisible="True"
    Style="{StaticResource UpDownTransitionPageStyle}">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Text="SETTINGS" Style="{StaticResource PhoneTextNormalStyle}"/>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <StackPanel>
                <StackPanel Style="{StaticResource InputFieldStyle}">
                    <TextBlock Text="Login Nickname"
                        Style="{StaticResource PhoneTextNormalStyle}" Foreground="{StaticResource PhoneSubtleBrush}"/>
                    <TextBox x:Name="txtLoginUsername" Text="{Binding LoginNickname, Mode=TwoWay}"
                        TextChanged="txt_TextChanged">
                        <TextBox.InputScope>
                            <InputScope>
                                <InputScopeName NameValue="LogOnName"/>
                            </InputScope>
                        </TextBox.InputScope>
                    </TextBox>
                </StackPanel>
                <StackPanel Style="{StaticResource InputFieldStyle}">
                    <TextBlock Text="Login Password"
                        Style="{StaticResource PhoneTextNormalStyle}" Foreground="{StaticResource PhoneSubtleBrush}"/>
                    <PasswordBox x:Name="txtLoginPassword" Password="{Binding LoginPassword, Mode=TwoWay}"
                        PasswordChanged="txtPassword_PasswordChanged"/>
                </StackPanel>
                <StackPanel Style="{StaticResource InputFieldStyle}">
                    <toolkit:ListPicker x:Name="listChatRefresh" Header="Download chat messages every" ExpansionMode="FullscreenOnly"
                        Loaded="listChatRefresh_Loaded" Margin="12,0,12,0">
                        <sys:String>Off</sys:String>
                        <sys:String>15 sec</sys:String>
                        <sys:String>30 sec</sys:String>
                        <sys:String>45 sec</sys:String>
                        <sys:String>1 minute</sys:String>
                        <sys:String>5 minute</sys:String>
                        <sys:String>10 minute</sys:String>
                        <toolkit:ListPicker.FullModeItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal" Margin="16 21 0 20">
                                    <TextBlock Text="{Binding}"
                                       Margin="0 0 0 0"
                                       FontSize="43" 
                                       FontFamily="{StaticResource PhoneFontFamilyLight}"/>
                                </StackPanel>
                            </DataTemplate>
                        </toolkit:ListPicker.FullModeItemTemplate>
                    </toolkit:ListPicker>
                </StackPanel>
                <StackPanel Style="{StaticResource InputFieldStyle}">
                    <toolkit:ToggleSwitch x:Name="chkSystemTray"
                        Header="Top system tray status icons"
                        Content="Hide"
                        Checked="chkSystemTray_Checked" Unchecked="chkSystemTray_Unchecked"
                        Loaded="chkSystemTray_Loaded" />
                </StackPanel>
            </StackPanel>
        </Grid>
    </Grid>
 
    <!--Sample code showing usage of ApplicationBar-->
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton x:Name="btnSave" IconUri="/Resources/appbar.check.rest.png" Text="done" Click="btnSave_Click"/>
            <shell:ApplicationBarIconButton x:Name="btnCancel" IconUri="/Resources/appbar.close.rest.png" Text="cancel" Click="btnCancel_Click"/>
            <shell:ApplicationBarIconButton x:Name="btnClearLogin" IconUri="/Resources/appbar.delete.rest.png" Text="clear login" Click="btnClearLogin_Click"/>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>
